import type { ApiResponse, ListResponse, MeetingRoom } from '/@/types/api'
import request from '/@/utils/request'

export interface ListParams {
  roomName?: string
  status?: string
  page?: number
  limit?: number
}

// 获取列表
export const getListApi = (params: ListParams) =>
  request.get<any, ApiResponse<ListResponse<MeetingRoom>>>('/api/conferenceRoomManagement', { params })

// 新增会议室
export const addApi = (data: Partial<MeetingRoom>) => request.post<any, ApiResponse<MeetingRoom>>('/api/conferenceRoomManagement', data)

// 更新会议室
export const editApi = (data: Partial<MeetingRoom>) =>
  request.put<any, ApiResponse<MeetingRoom>>(`/api/conferenceRoomManagement/${data.id}`, data)

// 删除会议室
export const delApi = (id: number) => request.delete<any, ApiResponse<void>>(`/api/conferenceRoomManagement/${id}`)

// 获取会议室详情
export const getDetailApi = (id: number) => request.get<any, ApiResponse<MeetingRoom>>(`/api/conferenceRoomManagement/show/${id}`)
